/**
 * Filename: MMConstants.js
 * Author: Wasay Abbasi
 * Date Created: 2012-01-10
 */

//Game configuration constants
var MM_BUILD_NUMBER = "1.0";
var MM_VERSION_NUMBER = "1.0";
var MM_APP_NAME = "AndroidMonsterMall";
var MM_IOS_APP_NAME = "iPhoneMonsterMall";

var MM_CURRENT_DB_PATH = "./Content/db";
//var MM_DB_RESOURCES = ['User.json', 'Zoo1.json','DefaultZoo.json','GameLevels.json'];
var MM_DB_RESOURCES = ['User.json'];

//MMBottom Bar
var BACKGROUND_HEIGHT = 60;
var STARTING_Y = 480 - BACKGROUND_HEIGHT;

//MMTop Bar
var TOP_BAR_BACKGROUND_HEIGHT = 50;

//MM alert window
var ACTION_ALERT_WINDOW_HEIGHT = 40;

// SOUNDS
var BG_MUSIC_PATH = './Content/audio/backgroundmusic.wav';
var COIN_COLLECT_SOUND = './Content/audio/coins.wav';
var TRASH_COLLECT_SOUND = './Content/audio/coins.wav';
var COIN_PRODUCED_SOUND = './Content/audio/cashregister.wav';
var NEW_AND_UPGRADE_SOUND = './Content/audio/drill.wav';
var BUTTON_TAP_SOUND = './Content/audio/tap.wav'


//FloorUI
var FLOOR_HEIGHT = 85;
var FLOOR_CONSTRUCTION_HEIGHT = 85;

//StoreUI
var kStorePlace = {
	kPlaceLeft: 0,
	kPlaceCenter: 1,
	kPlaceRight: 2
};

var kActionType = {
	kActionArrow: 0,
	kActionBuy: 1,
	kActionUseGift: 2
};

var kItemType = {
	kItemStore: 1,
	kItemDecoration: 2,
	kItemTemporary: 3,
	kItemLift: 4
};

var kElevatorMovement = {
	kElevatorMovementStill: 0,
	kElevatorMovementUp: 1,
	kElevatorMovementDown: 2	
};

var kSide = {
	kSideNone: 0,
	kSideLeft: 1,
	kSideRight: 2	
};

var kAvatarAction = {
	kAvatarActionFreeLance: 0,
	kAvatarActionVisitStore: 1,
	kAvatarActionShiftFloor: 2	
};

//action alert window
//var kAlert = {
//	kAlertBuyStore : Core.Localization.getString("BUY_STORE_ALERT"),
//	kAlertBuyDecoration : Core.Localization.getString("BUY_DECORATION_ALERT")
//};

//Avatar
var AVATAR_SPEED = 20;
var AVATAR_CHANGE_FLOOR_PROBABILITY = 0.5;
var ATATARS_PER_STORE = 0.5;
var MAX_NO_OF_AVATARS = 50;
var NO_OF_AVATAR_IMAGES = 4;

//Elevator
var ELEVATOR_SPEED = 60;
var FLOORS_PER_ELEVATOR = 4; 

//Trash
var NO_OF_TRASH_IMAGES = 7;
var TRASH_PER_STORE_PER_HOUR = 2;
var MAX_TRASH_COUNT = 25;
var TRASH_COLLECT_REWARD = 1;

var SECS_IN_ONE_DAY = 86400;

//INAPP
var kInAppType = {
	kInAppTypeCoins: 0,
	kInAppTypeNuggets: 1	
};

var kSwingDirection = {
	kSwingDirectionRight: 0,
	kSwingDirectionLeft: 1
};

var kMenuButton = {
	kMenuButtonShops: 0,
	kMenuButtonDecorations: 1,
	kMenuButtonLifts: 2,
	kMenuButtonFloors: 3,
	kMenuButtonZoom: 4,
	kMenuButtonRate: 5,
	kMenuButtonGifts: 6,
	kMenuButtonSettings: 7,
	kMenuButtonCoins: 8,
	kMenuButtonNuggets: 9
};

//var kTutorialText = {
//	kTutorialText0 : Core.Localization.getString("TUTORIAL_TEXT_0"),
//	kTutorialText1 : Core.Localization.getString("TUTORIAL_TEXT_1"),
//	kTutorialText2 : Core.Localization.getString("TUTORIAL_TEXT_2"),
//	kTutorialText3 : Core.Localization.getString("TUTORIAL_TEXT_3"),
//	kTutorialText4 : Core.Localization.getString("TUTORIAL_TEXT_4"),
//	kTutorialText5 : Core.Localization.getString("TUTORIAL_TEXT_5"),
//	kTutorialText6 : Core.Localization.getString("TUTORIAL_TEXT_6"),
//	kTutorialText7 : Core.Localization.getString("TUTORIAL_TEXT_7"),
//	kTutorialText8 : Core.Localization.getString("TUTORIAL_TEXT_8"),
//	kTutorialText9 : Core.Localization.getString("TUTORIAL_TEXT_9"),
//	kTutorialText10 : Core.Localization.getString("TUTORIAL_TEXT_10"),
//	kTutorialText11 : Core.Localization.getString("TUTORIAL_TEXT_11"),
//	kTutorialText12 : Core.Localization.getString("TUTORIAL_TEXT_12"),
//};

//Gift item type for friends
var kGiftType = {
	kGiftTypeStore : 1,
	kGiftTypeDecoration : 2
};

//friend actions
kNeighborActionType = {
	kNeighborActionTypeCollectCoinOrTrash : 1,
	kNeighborActionTypeCollectTrash : 2,
	kNeighborActionTypeSendGift : 3,
	kNeighborActionTypeCollectCoin: 4,
	kNeighborActionTypeStealCustomers: 5
};

//Social constants
var MAX_FRIEND_COIN_COLLECT = 5;
var MAX_FRIEND_TRASH_COLLECT = 5;
var MAX_AVATAR_STEAL_ACTION = 1;
var MIN_AVATAR_COUNT = 1;
var AVATAR_STEAL_COUNT = 2;
var REWARD_FOR_FRIEND_COIN = 10;

//Store progress bars
var kProgressBarType = {
	kProgressBarTypeUpgrade : 1,
	kProgressBarTypeRestock : 2,
};






//Common Constants
var MM_MAX_UPGRADE_LEVEL=4;
var MM_MAX_LEVEL_VALUE=80;
var MM_MAX_USER_COINS=99999;
var MM_MAX_USER_NUGGETS=99999;
var MM_REWARDPOINTS_THRESHOLD=40;
var MM_STORE_CONSTRUCTION_ID=8;
var MM_DOWNLOADING_TEXT="Fetching Data";
var MM_ALERT_LOCAL_TIME=1088;
var MM_GRID_SIZE = 60;
var MM_SELL_HABITAT_TAG = 3059321;
var BACKGROUND_MUSIC_PATH = './Content/Audio/jungle.mp3';
var MM_DEFINITE_INTERVAL = 3000;
//TZALertPanel 
var ALERT_ORDER_LVEL_LIMIT_MAX=10;
var ALERT_ORDER_LVEL_LIMIT_MIN=0;


///InAPP Constants////
var PRICE_POINTS_PER_PAGE = 3
var MM_COINS = 1
var MM_BUCKS = 2
var MM_COINS_TAG = 1;
var MM_BUCKS_TAG = 2;
/*
 * Animation Connstants..
 */

//Tags added by jabbar
var MM_NOT_ENOUGH_COINS_TAG = 220120;
var MM_NOT_ENOUGH_BUCKS_TAG = 220124;
var MM_UPGRADE_HABITAT_TAG = 3059322;
var MM_UPGRADE_CONCESSION_TAG =  3059326;
var MM_HABITAT_SPEED_UP_TAG =  3059323;
var MM_CONCESSION_SPEED_UP_TAG = 3059327
var MM_SELL_ANIMAL_TAG = 3059328;
var MM_CONCESSION_SELL_TAG = 3059325;
var MM_DECORATION_SELL_TAG = 3059324


var ANIMATION_START_X= -120;
var ANIMATION_END_X= 0;
var ANIMATION_START_Y= 0;
var ANIMATION_DURATION= .1;

var MM_FIRST_BREEDING_ROOM_PRICE= 1000;
var MM_OTHER_BREEDING_ROOM_PRICE= 40;
var MM_INVENTORY_LIMIT= 100;

var MM_MIN_TIME_TO_GET_COINS_STOLEN = 86400;

var MM_CURRENT_DB_PATH = "./Content/db";


var kTouchSwallower = 10;


var MM_MAX_GRID_ROWS = 100;

var MM_MIN_NUM_OF_COINS = 5 //4 new change to 5 @kamran ticket 463
var MM_MAX_NUM_OF_COINS = 25 //20 new change to 25 @kamran ticket 463
var MM_MAX_COINS_GENERATION_TIME = 60 //Time in Minutes

//Upgradation contants

var MM_UPGRADE_SPEEDUP_COST=1;
var MM_HABITAT_UPGRADE_TIME=14400;


var TUTORIAL_0_TAG = 0;
var TUTORIAL_1_TAG = 1;
var TUTORIAL_2_TAG = 2;
var TUTORIAL_3_TAG = 3;
var TUTORIAL_4_TAG = 4;
var TUTORIAL_5_TAG = 5;
var TUTORIAL_6_TAG = 6;
var TUTORIAL_7_TAG = 7;
var TUTORIAL_8_TAG = 8;
var TUTORIAL_9_TAG = 9;


var kObjectType = {
    kObjectHabitat: 0,
    kObjectDecoration: 1,
    kObjectAnimal: 2,
	kObjectConcession: 3,
	kObjectExpandLand: 4
};

var kMULActionType = {
    kMULActionArrow: 0,
    kMULActionMove: 1
};

var kAlertWindowType = {
	kCancelButton: 0,
	kOkButton: 1
};

var kVisitorDirections = {
	kDirectionUpLeft : 0,
	kDirectionUpRight : 1,
	kDirectionDownLeft : 2,
	kDirectionDownRight : 3
	
};

var kUpgradeStatus= {
	kUpgradeNone:0,
	kUpgradeInProgress:1,
	kUpgradeReadyForGrandOpening:2
};

var kAddBucksType= {         //enum defined for Limited type
	kLevelUp:0,
	kInApp:1,
	kStartUp:2,
	kOthers:3
} ;



var kOperationType= {
	kOperationAddCoins: 1,
	kOperationSubtractCoins :2,
	kOperationAddNuggets : 3,
	kOperationSubtractNuggets :4
} ;

var kVisitorActionTypes = {
	kVisitorActionConcession : 0,
	kVisitorActionHabitat : 1,
	kVisitorActionFreeLance : 2,
	kVisitorExit : 3
} ;

var kUserDefaultKeys = ["NotFirstRun","superUserFirstRun","unlockedItems","musicOn","effectsOn","actionCoinCollected","actionTrashCollected","actionStealCustomer"];

var kDictionaryType= {
	kAnimals:0,
	kHabitats:1,
	kDecorations:2,
	kAnimalBred: 5,
	kBredRoom:6,
	kBredSpeedUp: 7,
} ;

var kCurrencyType = {
	kCurrencyTypeCoins : 1,
	kCurrencyTypeNuggets : 2,
	
};

var kTickSound = {
	kTickSoundLevelUp : 1,
	kTickSoundCoinsClicked : 2,
} ;

var kBreedingRoomStatus = {
    kStatusRoomLock     : 0,
    kStatusRoomEmpty    : 1,
	kStatusFirstAnimal  : 2,
	kStatusSecondAnimal : 3,
	kStatusEgg          : 4,
	kStatusReady        : 5
};


var kdecoOperation = {
	kdecoNoOperation : 0,
	kdecoTend : 1,
	kdecoClean: 2,
};

var kQuestActionTypes = {	
	kQuestActionBuyItems : 0,
	kQuestVisitNeighbor : 1,
	kQuestPickTrash : 2,
	kQuestPickNeighborTrash : 3,
	kQuestUpgradeItems : 4,
	kQuestCollectCoinsFromItems : 5, // from animals and concessions
	kQuestCleanItems : 6, // clean/tend decorations,concessions
	kQuestFeedAnimals : 7, 
	kQuestBreedAnimals : 8,
	kQuestOfferCompleteBucks : 9,
	kQuestInAppPurchase : 10,
	kQuestExpandLand : 11,
	kQuestAddNewPark : 12,
	kQuestSpeedUpItems : 13,
	kQuestVisitorCount : 14,
	kQuestOfferCompleteCoins : 15,
};

var kQuestStatus = { 
	kQuestStatusLocked : 0,
	kQuestStatusInProgress : 1,
	kQuestStatusCompleted : 2,
};

var kQuestRewards = {	
	kQuestRewardCoins : 0,
	kQuestRewardBucks : 1,
	kQuestRewardXp : 2,
	
};

var validCharacters = {
	//to be done later for MONSTER MALL 
};



var kDecorationTypes = {
	kDecorationNormal : 0,
	kDecorationTendable : 1,
	
} ;

var kModelType = {
	kStoreModel : 0, 
	kCategoryModel : 1,
	kItemModel : 2,	
};

var kConnectResponse = {
    "_signature": "7df3dd9d890d3e3a060d4cdd14c010a52b7d5f81",
  "_customAttributes": {
    "mobclix_id": "F9777919-93DA-42A9-9895-5E55ED9ABDAE",
    "timeOutForSocial": "45000",
    "nooffriends": "3",
    "noofactions": "5",
    "rewardperaction": "1",
    "showmobclix": "0",
    "showspinner": "1",
    "tickerwindowtext": "To help a friend, tap on a crop or tree to revive or instantly grow it and receive %val1 buck(s).",
    "witheredmessage": "%val1 revived a withered %val2! Visit %val3 and help back!",
    "growmessage": "%val1 helped grow  %val2! Visit %val3 and help back!",
    "alreadyhelpfriend1": "You have already helped %val1 and %val2 friend(s) for the day. Please come back tomorrow.",
    "alreadyhelpfriend2": "You have already helped %val1 friend(s) for the day. Please come back tomorrow.",
    "alreadyhelpfriend3": "You have already helped %val1 for the day! Please come back tomorrow!",
    "revivedmessage": "You have revived %val1 and received %val2 Buck(s)!",
    "instantlygrownmessage": "You have instantly grown %val1 and received %val2 Buck(s)!",
    "showanalyticshandler": "1"
  },
  "_currencyUpdated": "false",
  "_defaultGame": "ngMM",
  "_device": "98AD858E-8A42-5330-9F0B-1A494C34051D",
  "_devStat": "exist",
  "_appsalar": "on",
  "_showAds": "off",
  "_firstGameState": null,
  "_game": "ngTR",
  "_gameId": "84e305cf80f14b1caf51c58b3118088a",
  "_gameServer": "http://ngtapranchstate.appspot.com/gameState",
  "_inAppenAbled": "true",
  "_offerServer": "http://gameviewoffers.appspot.com/",
  "_requestType": "gameConnect-GET",
  "_serverTime": "1329230401",
  "_status": "OK",
  "_storeServer": "http://ngtapranchvstore.appspot.com/",
  "_superUser": false,
  "_offersUrl": null,
  "_appurl": "",
  "_checkOutServer": "http://gvscheckout.appspot.com/",
  "_qaUser": false,
  "_socialServer": "http://gvstapfriends.appspot.com/",
  "_currentTime": null,
  "_timeDifference": -72.19199991226196,
  "_pnsurl": "",
  "_isActive": "true",
  "_serverResponse": {
    "@status": "OK",
    "@pnsurl": "",
    "@appsalar": "on",
    "@socialserver": "http://gvstapfriends.appspot.com/",
    "@storeserver": "http://ngtapranchvstore.appspot.com/",
    "@game": "ngTR",
    "@game_id": "84e305cf80f14b1caf51c58b3118088a",
    "@socialMsgsEnabled": "True",
    "@device": "98AD858E-8A42-5330-9F0B-1A494C34051D",
    "@notificationserver": "http://gvsocialnotificationserver.appspot.com/",
    "@precan_msg_version": "5",
    "@inappenabled": "true",
    "dazzle": {
      "@log_offer": "1",
      "@logging_type": "3",
      "@log_event": "1",
      "@time_threshold": "30",
      "@count_threshold": "10",
      "@log_transaction": "1",
      "@dazzle_server": "http://vmart.cdocs.local/addTransactions/"
    },
    "@checkoutserver": "http://gvscheckout.appspot.com/",
    "custom_attributes": "{\"mobclix_id\":\"F9777919-93DA-42A9-9895-5E55ED9ABDAE\",\"timeOutForSocial\":\"45000\",\"nooffriends\":\"3\",\"noofactions\":\"5\",\"rewardperaction\":\"1\",\"showmobclix\":\"0\",\"showspinner\":\"1\",\"tickerwindowtext\":\"To help a friend, tap on a crop or tree to revive or instantly grow it and receive %val1 buck(s).\",\"witheredmessage\":\"%val1 revived a withered %val2! Visit %val3 and help back!\",\"growmessage\":\"%val1 helped grow  %val2! Visit %val3 and help back!\",\"alreadyhelpfriend1\":\"You have already helped %val1 and %val2 friend(s) for the day. Please come back tomorrow.\",\"alreadyhelpfriend2\":\"You have already helped %val1 friend(s) for the day. Please come back tomorrow.\",\"alreadyhelpfriend3\":\"You have already helped %val1 for the day! Please come back tomorrow!\",\"revivedmessage\":\"You have revived %val1 and received %val2 Buck(s)!\",\"instantlygrownmessage\":\"You have instantly grown %val1 and received %val2 Buck(s)!\",\"showanalyticshandler\":\"1\"}",
    "@requesttype": "gameConnect-GET",
    "@qauser": "no",
    "@userkey": "zakitest",
    "@offerserver": "http://gameviewoffers.appspot.com/",
    "@debug": "False",
    "@isactive": "true",
    "@superuser": "no",
    "@appurl": "",
    "storeItemVersion": {
      "store": [
        {
          "@store_id": "12153c31a1074b738a0e930aa45a197f",
          "@is_active": "1",
          "@visible_id": "1",
          "@game_id": "",
          "@position": "1",
          "@name": "Buildings",
          "@version": "1000"
        },
        {
          "@store_id": "12153c31a1074b738a0e930aa45a197f",
          "@is_active": "1",
          "@visible_id": "2",
          "@game_id": "",
          "@position": "2",
          "@name": "Decorations",
          "@version": "1000"
        },
        {
          "@store_id": "12153c31a1074b738a0e930aa45a197f",
          "@is_active": "1",
          "@visible_id": "3",
          "@game_id": "",
          "@position": "3",
          "@name": "Floors",
          "@version": "1000"
        },
        {
          "@store_id": "12153c31a1074b738a0e930aa45a197f",
          "@is_active": "1",
          "@visible_id": "4",
          "@game_id": "",
          "@position": "4",
          "@name": "Lifts",
          "@version": "1000"
        },
        {
          "@store_id": "12153c31a1074b738a0e930aa45a197f",
          "@is_active": "1",
          "@visible_id": "9",
          "@game_id": "",
          "@position": "9",
          "@name": "Currency",
          "@version": "1000"
        }
      ]
    },
    "@devstat": "exist",
    "@servertime": "1329230401",
    "neighboractions": [],
    "currencies": {
      "currency": [
        {
          "@currency": "nuggets",
          "@value": "0"
        },
        {
          "@currency": "coins",
          "@value": "0"
        },
        {
          "@currency": "purchasednuggets",
          "@value": "0"
        },
        {
          "@currency": "purchasedcoins",
          "@value": "0"
        },
        {
          "@currency": "deductednuggets",
          "@value": "0"
        },
        {
          "@currency": "deductedcoins",
          "@value": "0"
        }
      ],
      "@VStat": "100"
    },
    "Signature": "7df3dd9d890d3e3a060d4cdd14c010a52b7d5f81",
    "@gameserver": "http://ngtapranchstate.appspot.com/gameState",
    "UserMessage": {
      "@category": "",
      "#text": "Welcome to Tap Ranch+",
      "@store": "10",
      "@itemId": ""
    },
    "SocialAction": {
      "friendAdded": "False"
    },
    "@showads": "off",
    "@default_game": "ngTR",
    "@currencyupdated": "false"
  },
  "_currencyModelArray": [
    {
      "_currency": "nuggets",
      "_value": "0"
    },
    {
      "_currency": "coins",
      "_value": "0"
    },
    {
      "_currency": "purchasednuggets",
      "_value": "0"
    },
    {
      "_currency": "purchasedcoins",
      "_value": "0"
    },
    {
      "_currency": "deductednuggets",
      "_value": "0"
    },
    {
      "_currency": "deductedcoins",
      "_value": "0"
    }
  ],
  "_storesModelArray": [
    {
      "_storeName": "Buildings",
      "_position": "1",
      "_store_id": "12153c31a1074b738a0e930aa45a197f",
      "_storeVersion": "1000",
      "_visible_id": "1",
      "_isActive": "1",
      "_game_id": ""
    },
    {
      "_storeName": "Decorations",
      "_position": "2",
      "_store_id": "12153c31a1074b738a0e930aa45a197f",
      "_storeVersion": "1000",
      "_visible_id": "2",
      "_isActive": "1",
      "_game_id": ""
    },
    {
      "_storeName": "Floors",
      "_position": "3",
      "_store_id": "12153c31a1074b738a0e930aa45a197f",
      "_storeVersion": "1000",
      "_visible_id": "3",
      "_isActive": "1",
      "_game_id": ""
    },
    {
      "_storeName": "Lifts",
      "_position": "4",
      "_store_id": "12153c31a1074b738a0e930aa45a197f",
      "_storeVersion": "1000",
      "_visible_id": "4",
      "_isActive": "1",
      "_game_id": ""
    },
    {
      "_storeName": "Currency",
      "_position": "9",
      "_store_id": "12153c31a1074b738a0e930aa45a197f",
      "_storeVersion": "1000",
      "_visible_id": "9",
      "_isActive": "1",
      "_game_id": ""
    }
  ],
  "_userMessageModel": {
    "_category": "",
    "_itemId": "",
    "_storeName": "10",
    "_message": "Welcome to Tap Ranch+"
  },
  "_count_threshold": "10",
  "_dazzle_server": "http://vmart.cdocs.local/addTransactions/",
  "_logging_type": "3",
  "_time_threshold": "30",
  "_log_transaction": true,
  "_log_event": true,
  "_log_offer": true,
  "_friendAdded": false,
  "_promotions": null
};